#ifndef CRYPTO_GRAPHIC_H_
#define CRYPTO_GRAPHIC_H_

#define RSA_LENGTH 2048
#define SERVER_PUB_PATH ".shadow/server/pub.pem"
#define SERVER_PRV_PATH ".shadow/server/prv.pem"

#include <string>
/// @brief 调用openssl
class CryptoGraphic
{
public:
    /// @brief 生成一对rsa秘钥
    void GenerateRSA(int bits);
    /// @brief 获取私钥 必须先生成密钥对
    std::string PrivateKey() const;
    /// @brief 获取公钥
    std::string PublicKey() const;
    /// @brief 使用私钥将密文转换成明文
    std::string DecryptRSA(std::string prv_key, const char *cipher_text, int cipher_text_len);

private:
    std::string prv_key_str_;
    std::string pub_key_str_;
};

#endif